<!--
 * @Author: gyc
 * @Date: 2020-05-21 10:10:40
 * @LastEditTime: 2020-08-14 16:41:25
 * @Description: Nuxt测试版
--> 
<template>
  <div class="mo-user-info">
    <user-info :info="userInfo"></user-info>
  </div>
</template>

<script>
import userInfo from "@/components/user/userInfo/userInfo";
import { Decrypt, Encrypt } from "@/assets/js/utils.js";
export default {
  name: "moUserInfo",
  layout: "userPage",
  data() {
    return {
      userInfo: "",
      userid: 16,
    };
  },
  async asyncData(context) {
    //用户确认
    let user;
    await context.$axios.get("/isAuthenticated").then(async (res) => {
      console.log(res.data.userid);
      user = await context.$axios.get("/api/user/info", {
        params: {
          userid: res.data.userid,
        },
      });
    });
    return { userInfo: user.data.data };
  },
  mounted() {
  },
  components: {
    "user-info": userInfo,
  },
};
</script>
<style lang="scss" scoped>
.mo-user-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  // justify-content: center;
}
.info-title {
  display: flex;
  width: 100%;
  height: 60px;
  margin-bottom: 10px;
  box-shadow: 0px 0px 6px #dedede;
  .info-title-item {
    position: relative;
    display: flex;
    width: 33.33334%;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    span {
      position: relative;
      &:nth-of-type(1) {
        font-weight: bold;
        letter-spacing: 2px;
      }
    }
  }
  // border: 1px solid #ccc;
}
</style>